require("../css/commCss/normalize.less");
require("../css/commCss/reset.less");
require("../css/commCss/property.less");
require("../css/commCss/basic.less");
require("../fonts/iconfont.css");
require("../css/biking.less")

//axios
const axios = require("axios");

//导入util
const util = require("../util/util");

document.addEventListener("DOMContentLoaded", function () {
   /* 获取元素 */
   const go=document.querySelector('#go')
   const ridekm=document.querySelector('#ridekm')

   //点击go，跳转页面
   go.addEventListener('click',function(){
     location.href='./countdown.html'
   })
 
   /* 头部导航 */
  util.soprtTopNav("biking");

    /*1. 底部导航 */
  util.fixBottomNav("running");

  //发送请求
  let userId=localStorage.userId;
  axios.get('http://139.9.177.51:8099/sports/exerciseData?id='+userId)
  .then(function(res){
    let data=res.data.data

    //渲染跑步距离
    ridekm.textContent=data.ridekm;
  })

  
})